//
//  JHSSicknessDetailView.m
//  detailVC
//
//  Created by chenWei on 2017/3/23.
//  Copyright © 2017年 陈伟. All rights reserved.
//

#import "JHSSicknessDetailView.h"
#import "Masonry.h"
#import "JHSSickTypeController.h"
#import "JHSSicknessDetailController.h"

@implementation JHSSicknessDetailView

-(instancetype)init{
    
    if (self = [super init]) {
        
        [self setupUI];
    }
    
    return self;
}

- (void)awakeFromNib {
    [super awakeFromNib];
    
    [self setupUI];
}

- (void)setupUI
{
    self.backgroundColor = [UIColor colorWithRed:239 / 255.0 green:239 / 255.0 blue:243 / 255.0 alpha:1];
    
    //病型标签
    UILabel *lab = [[UILabel alloc]init];
    
    lab.text = @"疾病类型：血液科";
    [lab sizeToFit];
    
    lab.textColor = [UIColor darkGrayColor];
    
    [self addSubview:lab];
    
    [lab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(30);
        make.top.offset(64 + 18);
    }];
    
    
    //添加手势
    UITapGestureRecognizer *tap1 = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(tap1:)];
    
    UITapGestureRecognizer *tap2 = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(tap2:)];
    
    
    //第一个：UIImageView
    UIView *firstV = [[UIView alloc]init];
    firstV.backgroundColor = [UIColor whiteColor];
    firstV.layer.cornerRadius = 5;
    firstV.layer.masksToBounds = YES;
    
    //给第一个 view 添加手势
    [firstV addGestureRecognizer:tap1];
    
    
    [self addSubview:firstV];
    
    [firstV mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(25);
        make.top.equalTo(lab.mas_bottom).offset(26);
        make.right.offset(-25);
        make.height.offset(35.5);
    }];
    
    //在 imgV上添加 lab,btn
    UILabel *typeLab = [[UILabel alloc]init];
    typeLab.text = @"请选择疾病类型：";
    typeLab.textColor = [UIColor colorWithRed:116 / 255.0 green:191 / 255.0 blue:159 / 255.0 alpha:1];
    [typeLab sizeToFit];
    
    [firstV addSubview:typeLab];
    [typeLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(5);
        make.centerY.equalTo(firstV.mas_centerY).offset(0);
    }];
    
    UIButton *btn = [[UIButton alloc]init];
    [btn setImage:[[UIImage imageNamed:@"position-right"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] forState:UIControlStateNormal];
    
    [firstV addSubview:btn];
    
    [btn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.offset(20);
        make.centerY.equalTo(firstV.mas_centerY).offset(0);
        make.size.mas_offset(CGSizeMake(30, 40));
    }];
    
    
    
    
    //第二个：UIImageView
    UIView *secondV = [[UIView alloc]init];
    secondV.backgroundColor = [UIColor whiteColor];
    secondV.layer.cornerRadius = 5;
    secondV.layer.masksToBounds = YES;
    
    //给第二个 view添加手势
    [secondV addGestureRecognizer:tap2];
    
    
    [self addSubview:secondV];
    
    [secondV mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(25);
        make.top.equalTo(firstV.mas_bottom).offset(13);
        make.right.offset(-25);
        make.height.offset(35.5);
    }];
    
    //在 imgV上添加 lab,btn
    UILabel *mutiLab = [[UILabel alloc]init];
    mutiLab.text = @"请选择多发病症(多选)：";
    mutiLab.textColor = [UIColor colorWithRed:116 / 255.0 green:191 / 255.0 blue:159 / 255.0 alpha:1];
    [mutiLab sizeToFit];
    
    [secondV addSubview:mutiLab];
    [mutiLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(5);
        make.centerY.equalTo(secondV.mas_centerY).offset(0);
    }];
    
    
    //第三个：UIImageView
    UIView *thirdV = [[UIView alloc]init];
    thirdV.backgroundColor = [UIColor whiteColor];
    thirdV.layer.cornerRadius = 5;
    thirdV.layer.masksToBounds = YES;
    
    [self addSubview:thirdV];
    
    [thirdV mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(25);
        make.top.equalTo(secondV.mas_bottom).offset(13);
        make.right.offset(-25);
        make.height.offset(35.5);
    }];
    
    //在 imgV上添加 lab,btn
    UILabel *sureLab = [[UILabel alloc]init];
    sureLab.text = @"是否已确诊：";
    sureLab.textColor = [UIColor colorWithRed:116 / 255.0 green:191 / 255.0 blue:159 / 255.0 alpha:1];
    [sureLab sizeToFit];
    
    [thirdV addSubview:sureLab];
    [sureLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(5);
        make.centerY.equalTo(thirdV.mas_centerY).offset(0);
    }];
    
    //按钮1
    UIButton *chooseBtn1 = [[UIButton alloc]init];
    [chooseBtn1 setImage:[UIImage imageNamed:@"illness_rb_img_nor.png"] forState:UIControlStateNormal];
    [chooseBtn1 setImage:[UIImage imageNamed:@"illness_rb_img_sel.png"] forState:UIControlStateHighlighted];
    [chooseBtn1 setTitle:@" 已确诊" forState: UIControlStateNormal];
    chooseBtn1.font = [UIFont systemFontOfSize:15];
    
    [chooseBtn1 setTitleColor:[UIColor colorWithRed:116 / 255.0 green:191 / 255.0 blue:159 / 255.0 alpha:1] forState:UIControlStateNormal];
    
    [thirdV addSubview:chooseBtn1];
    
    [chooseBtn1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.offset(0);
        make.centerY.offset(0);
        make.size.mas_offset(CGSizeMake(65, 20));
    }];
    
    //按钮2
    UIButton *chooseBtn2 = [[UIButton alloc]init];
    [chooseBtn2 setImage:[UIImage imageNamed:@"illness_rb_img_nor.png"] forState:UIControlStateNormal];
    [chooseBtn2 setImage:[UIImage imageNamed:@"illness_rb_img_sel.png"] forState:UIControlStateHighlighted];
    [chooseBtn2 setTitle:@" 症状疑似" forState: UIControlStateNormal];
    chooseBtn2.font = [UIFont systemFontOfSize:15];
    
    [chooseBtn2 setTitleColor:[UIColor colorWithRed:116 / 255.0 green:191 / 255.0 blue:159 / 255.0 alpha:1] forState:UIControlStateNormal];
    
    [thirdV addSubview:chooseBtn2];
    
    [chooseBtn2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(chooseBtn1.mas_right).offset(15);
        make.centerY.offset(0);
        make.size.mas_offset(CGSizeMake(100, 20));
    }];
    
    
    
    
    
    
    //第四个：UIImageView
    UIView *fourV = [[UIView alloc]init];
    fourV.backgroundColor = [UIColor whiteColor];
    fourV.layer.cornerRadius = 5;
    fourV.layer.masksToBounds = YES;
    
    [self addSubview:fourV];
    
    [fourV mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(25);
        make.top.equalTo(thirdV.mas_bottom).offset(13);
        make.right.offset(-25);
        make.height.offset(35.5);
    }];
    
    //在 imgV上添加 lab,btn
    UILabel *yiliaoLab = [[UILabel alloc]init];
    yiliaoLab.text = @"是否有医疗史：";
    yiliaoLab.textColor = [UIColor colorWithRed:116 / 255.0 green:191 / 255.0 blue:159 / 255.0 alpha:1];
    [yiliaoLab sizeToFit];
    
    [fourV addSubview:yiliaoLab];
    [yiliaoLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(5);
        make.centerY.equalTo(fourV.mas_centerY).offset(0);
    }];
    
    //按钮1
    UIButton *chooseBtn3 = [[UIButton alloc]init];
    [chooseBtn3 setImage:[UIImage imageNamed:@"illness_rb_img_nor.png"] forState:UIControlStateNormal];
    [chooseBtn3 setImage:[UIImage imageNamed:@"illness_rb_img_sel.png"] forState:UIControlStateHighlighted];
    [chooseBtn3 setTitle:@" 接受过" forState: UIControlStateNormal];
    chooseBtn3.font = [UIFont systemFontOfSize:15];
    
    [chooseBtn3 setTitleColor:[UIColor colorWithRed:116 / 255.0 green:191 / 255.0 blue:159 / 255.0 alpha:1] forState:UIControlStateNormal];
    
    //给按钮1添加监听方法
    
    
    
    
    [fourV addSubview:chooseBtn3];
    
    [chooseBtn3 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.offset(0);
        make.centerY.offset(0);
        make.size.mas_offset(CGSizeMake(65, 20));
    }];
    
    //按钮2
    UIButton *chooseBtn4 = [[UIButton alloc]init];
    [chooseBtn4 setImage:[UIImage imageNamed:@"illness_rb_img_nor.png"] forState:UIControlStateNormal];
    [chooseBtn4 setImage:[UIImage imageNamed:@"illness_rb_img_sel.png"] forState:UIControlStateHighlighted];
    [chooseBtn4 setTitle:@" 未接受过" forState: UIControlStateNormal];
    chooseBtn4.font = [UIFont systemFontOfSize:15];
    
    [chooseBtn4 setTitleColor:[UIColor colorWithRed:116 / 255.0 green:191 / 255.0 blue:159 / 255.0 alpha:1] forState:UIControlStateNormal];
    
    [fourV addSubview:chooseBtn4];
    
    [chooseBtn4 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(chooseBtn3.mas_right).offset(15);
        make.centerY.offset(0);
        make.size.mas_offset(CGSizeMake(100, 20));
    }];
    
    
    
    
    //第五个：UIImageView
    UIView *fiveV = [[UIView alloc]init];
    fiveV.backgroundColor = [UIColor whiteColor];
    fiveV.layer.cornerRadius = 5;
    fiveV.layer.masksToBounds = YES;
    
    [self addSubview:fiveV];
    
    [fiveV mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(25);
        make.top.equalTo(fourV.mas_bottom).offset(13);
        make.right.offset(-25);
        make.height.offset(35.5);
    }];
    
    //在 imgV上添加 lab,btn
    UILabel *methodLab = [[UILabel alloc]init];
    methodLab.text = @"曾经的治疗方式：";
    methodLab.textColor = [UIColor colorWithRed:116 / 255.0 green:191 / 255.0 blue:159 / 255.0 alpha:1];
    [methodLab sizeToFit];
    
    [fiveV addSubview:methodLab];
    [methodLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(5);
        make.centerY.equalTo(fiveV.mas_centerY).offset(0);
    }];
    
    
    //匹配
    UILabel *piPeiLab = [[UILabel alloc]init];
    piPeiLab.text = @"一共为您匹配到";
    piPeiLab.textColor = [UIColor darkGrayColor];
    [self addSubview:piPeiLab];
    [piPeiLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(methodLab.mas_bottom).offset(70);
        make.centerX.offset(0);
    }];
    
    //医生数
    UILabel *doctorCount = [[UILabel alloc]init];
    doctorCount.text = @"24位医生";
    doctorCount.font = [UIFont systemFontOfSize:20];
    doctorCount.textColor = [UIColor colorWithRed:116 / 255.0 green:191 / 255.0 blue:159 / 255.0 alpha:1];
    [self addSubview:doctorCount];
    [doctorCount mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(piPeiLab.mas_bottom).offset(20);
        make.centerX.offset(0);
    }];
    
    //医生头像
    UIImageView *doctorImgV = [[UIImageView alloc]init];
    doctorImgV.image = [[UIImage imageNamed:@"doctorCount"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    doctorImgV.layer.cornerRadius = 20;
    doctorImgV.layer.masksToBounds = YES;
    [self addSubview:doctorImgV];
    [doctorImgV mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(doctorCount.mas_bottom).offset(20);
        make.centerX.offset(0);
    }];
    
    
    
    //预约 btn
    UIButton *yuYueBtn = [[UIButton alloc]init];
    [yuYueBtn setContentMode:UIViewContentModeCenter];
    [yuYueBtn setTitle:@"申请预约" forState: UIControlStateNormal];
    [yuYueBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    yuYueBtn.backgroundColor = [UIColor colorWithRed:116 / 255.0 green:191 / 255.0 blue:159 / 255.0 alpha:1];
    
    //设置按钮为圆形
    yuYueBtn.layer.cornerRadius = 10;
    yuYueBtn.layer.masksToBounds = YES;
    
    [self addSubview:yuYueBtn];
    
    [yuYueBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(40);
        make.right.offset(-40);
        make.bottom.offset(-15);
        make.height.offset(40);
    }];

    
    
    
}

//




@end
